{% extends "base.html" %}
{% block title %} 用户管理 {% endblock title %}
{% block scripts %}
<script type="text/javascript" src="/medias/js/jquery-1.2.6.min.js"></script> 
<script type="text/javascript" src="/medias/js/jquery.tablesorter.min.js"></script> 
<script type="text/javascript" src="/medias/js/thickbox-compressed.js"></script>
<link rel="stylesheet" href="/medias/thickbox.css" type="text/css" media="screen" />
<script type="text/javascript">

function user_change_status(u_id){
	if (window.confirm('改变用户状态?\n\n用户被锁定后将不可登陆,但数据仍然有效')){location.href='/user-manage/chstatus/'+u_id}
	}
	
function user_change_password(u_id){
	window.open('/user-manage/chpass/'+u_id, '_blank', 'width=420,height=250,menubar=no,toolbar=no,location=no,status=no,scrollbars=no,resizable=no')
	}
	
</script>
{% endblock scripts %}
{% block content %}            
<div class="box">
<table border="0" cellpadding="0">
  <caption>
    {{ user.username }}
  </caption>
  <thead>
  <tr>
    <th scope="col" width="200px" class="alt">属性</th>
    <th scope="col">内容</th>
    <th scope="col">说明/操作</th>
  </tr>
  </thead>
  <tbody>
  <tr>
    <td class="alt">用户中文名称</td>
    <td>{{ user.get_profile.user_chinese_name }}</td>
    <td> &nbsp;</td>
  </tr>
  <tr>
    <td class="alt">用户联系电话</td>
    <td>{{ user.get_profile.user_phone }}</td>
    <td>&nbsp;</td>
  </tr>
    <tr>
    <td class="alt">用户Email</td>
    <td>{{ user.email }}</td>
    <td>&nbsp;</td>
  </tr>
    <tr>
    <td class="alt">用户银行账号信息</td>
    <td><p>{{ user.get_profile.user_bank_name }}</p>
    	<p>{{ user.get_profile.user_bank_acct }}</p>
        <p>{{ user.get_profile.user_bank_acct_name }}</p>
        <p>{{ user.get_profile.user_identity_card }}</p></td>
    <td><p>账户所在银行/账户/账户所属人/身份号码></p></td>
  </tr>
    <tr>
    <td class="alt">U-Point</td>
    <td>{{ user.get_profile.user_u_point }}</td>
    <td>换算用户点数</td>
  </tr>
    <tr>
    <td class="alt">管理者</td>
    <td>{{ user.get_profile.user_create_by.username }}</td>
    <td>&nbsp;</td>
  </tr>
    <tr>
    <td class="alt">用户唯一ID</td>
    <td>{{ user.get_profile.user_unique_str }}</td>
    <td>用来验证用户的系统唯一性</td>
  </tr>

	<td class="alt">属组</td>
    <td><ul class="nopadding">
				{% block group %}
					{% for g in user.groups.all %}
					<li class="nopadding">{{ g.name|upper }}</li>
					{% endfor %}
				{% endblock %}
			</ul>
     </td>
    <td>&nbsp;</td>
 	</tr>
    <tr>
    <td class="alt">用户说明</td>
    <td>{{ user.get_profile.user_desc }}</td>
    <td>&nbsp;</td>
  </tr>
	<tr>
    <td class="alt">用户使用状态</td>
    <td>{{ user.is_active|yesno:"正常,锁定,未知"}}</td>
    <td>&nbsp;</td>
  </tr>
  </tbody>
  <tfoot>
  <tr><td colspan=20><p>用户操作:
<a href="javascript:void({{ user.id }})" title="改变用户状态"><img src="/medias/image/user_delete.png" width="16" height="16" border="0" alt="改变用户状" onclick="javascript:user_change_status({{ user.id }})"></a>&nbsp;&nbsp;
		<a href="/user-manage/chpass/{{ user.id }}/?height=180&width=330&TB_iframe=true" class="thickbox" title="修改用户[{{ user.username }}]的密码"><img src="/medias/image/user_password.png" width="16" height="16" border="0" alt="修改用户[{{ x.username }}]的密码"></a>&nbsp;
		<a href="/user-manage/detail/{{ user.id }}" title="查看用户信息"><img src="/medias/image/user_edit.png" width="16" height="16" border="0" alt="查看用户信息"></a></p></td></tr></tfoot>
  </tfoot>
</table>

</div>
{% endblock content %}
